<%-- 
    Document   : editVote
    Created on : Nov 7, 2009, 2:31:21 AM
    Author     : Phong
--%>

<%@page contentType="text/html" pageEncoding="UTF-8" import="java.sql.*, DAOClass.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script src="../JavaScript/form.js" type="text/javascript"></script>


        <link rel="stylesheet" href="../css/form.css" />
        <link rel="stylesheet" href="../css/style.css" />
        <title>Edit Vote</title>
    </head>
    <body>

        <%
            int id = Integer.parseInt(request.getParameter("id"));
            vote objV = new vote();
            ResultSet re = null;
            String voteN = "";
            String TimeFrom = "";
            String EndTime = "";
            int Status = 2;
            re = objV.selectVoteById(id);
            while (re.next())   {
                voteN = re.getString("VoteName");
                TimeFrom = re.getString("CreateTime");
                EndTime = re.getString("EndTime");
                Status = Integer.parseInt(re.getString("Status"));
            }

        %>
        <table width="100%" cellpadding="2" cellspacing="0" class="tbmain">
            <tr><td class="topleft" width="10" height="10">&nbsp;</td>
                <td class="topmid">&nbsp;</td>
                <td class="topright" width="10" height="10">&nbsp;</td>
            </tr>
            <tr>
                <td class="midleft" width="10">&nbsp;&nbsp;&nbsp;</td>
                <td class="midmid" valign="top">
                    <form accept-charset="utf-8"  action=""  method="post" name="editVote">
                        <input type="hidden" name="formID" value="93093336434" />
                        <div id="main">
                            <div class="pagebreak">
                                <table width="520" cellpadding="5" cellspacing="0">
                                    <tr >
                                        <td width="150" class="left" >
                                            <label >VoteName: <span class="required">*</span></label>
                                        </td>
                                        <td class="right" >
                                            <input type="text" size="40" name="VoteName" class="text" value="<%=voteN%>" id="q2"  onblur="validate(this,'Required')"  maxlength="100" maxsize="100" />
                                        </td>
                                    </tr>
                                    <tr >
                                        <td width="150" class="left" >
                                            <label >Create From: <span class="required">*</span></label>
                                        </td>
                                        <td class="right" >
                                            <input type="text" size="20"  readonly name="CreateFrom" class="text" value="<%=TimeFrom%>" id="q3"  onblur="validate(this,'Required')"  maxlength="100" maxsize="100" />
                                        </td>
                                    </tr>
                                    <tr >
                                        <td width="150" class="left" >
                                            <label>End Date: <span class="required">*</span></label>
                                        </td>
                                        <td class="right">
                                            <script type="text/javascript" src="../JavaScript/datetimepicker.js"></script>
                                            <input type="text" class="text" size="10" name="EndDate" id="q5"   onblur="validate(this,'Required')"  />
                                            <a href="javascript:NewCal('q5','mmddyyyy',false,12)">
                                                <img src="../images/cal.gif"border="0" alt="Pick a date" /></a>
                                        </td>
                                    </tr>
                                    <tr >
                                        <td width="150" class="left" valign="top" >
                                            <label>Status <span class="required">*</span></label>
                                        </td>
                                        <td class="right">
                                            <input type="radio"  class="other" name="q6_Status" id="q6_0" value="3"   onblur="validate(this,'Required')"  />
                                            <label class="left">Display</label> <br />
                                            <input type="radio"  class="other" name="q6_Status" id="q6_1" value="2" checked   onblur="validate(this,'Required')"  />
                                            <label class="left">Waitting</label> <br />
                                            <input type="radio"  class="other" name="q6_Status" id="q6_2" value="1"   onblur="validate(this,'Required')"  />
                                            <label class="left">Blocked</label> <br />
                                        </td>
                                    </tr>

                                    <tr >
                                        <td width="150" class="left" >&nbsp;

                                        </td>
                                        <td class="right">
                                            <input type="submit" class="btn" value="Submit" />
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                    </form>
                </td>
                <td class="midright" width="10">&nbsp;&nbsp;&nbsp;</td>
            </tr>
            <tr>
                <td class="bottomleft" width="10" height="10">&nbsp;</td>
                <td class="bottommid">&nbsp;</td>
                <td class="bottomright" width="10" height="10">&nbsp;</td>
            </tr>
        </table>
        <script type="text/javascript">
            validate("editVote");
        </script>
    </body>
</html>
